﻿using System.Data.Entity;
using System.Data.Entity.Infrastructure;
using LibraryHub.DataAccess.EntityFramework;

namespace LibraryHub.DataAccess
{
    class DatabaseConnection
    {
        static DatabaseConnection()
        {
            Database.DefaultConnectionFactory = new SqlCeConnectionFactory("System.Data.SqlServerCe.4.0");
            Database.SetInitializer(new DropCreateSeedDatabaseAlways());

            Db = new LibraryHubContext();
        }

        public static LibraryHubContext Db { get; set; }
    }
}
